class RegimeletivosController < ApplicationController
  # GET /regimeletivos
  # GET /regimeletivos.xml
  def index
    @regimeletivos = Regimeletivo.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @regimeletivos }
    end
  end

  # GET /regimeletivos/1
  # GET /regimeletivos/1.xml
  def show
    @regimeletivo = Regimeletivo.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @regimeletivo }
    end
  end

  # GET /regimeletivos/new
  # GET /regimeletivos/new.xml
  def new
    @regimeletivo = Regimeletivo.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @regimeletivo }
    end
  end

  # GET /regimeletivos/1/edit
  def edit
    @regimeletivo = Regimeletivo.find(params[:id])
  end

  # POST /regimeletivos
  # POST /regimeletivos.xml
  def create
    @regimeletivo = Regimeletivo.new(params[:regimeletivo])

    @regimeletivo = modifica @regimeletivo,params[:regimeletivo]

    respond_to do |format|
      if @regimeletivo.save
        flash[:notice] = 'Regimeletivo was successfully created.'
        format.html { redirect_to(regimeletivos_url) }
        format.xml  { render :xml => @regimeletivo, :status => :created, :location => @regimeletivo }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @regimeletivo.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /regimeletivos/1
  # PUT /regimeletivos/1.xml
  def update
    @regimeletivo = Regimeletivo.find(params[:id])

    respond_to do |format|
      if @regimeletivo.update_attributes(params[:regimeletivo])
        flash[:notice] = 'Regimeletivo was successfully updated.'
        format.html { redirect_to(regimeletivos_url) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @regimeletivo.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /regimeletivos/1
  # DELETE /regimeletivos/1.xml
  def destroy
    @regimeletivo = Regimeletivo.find(params[:id])
    @regimeletivo.destroy

    respond_to do |format|
      format.html { redirect_to(regimeletivos_url) }
      format.xml  { head :ok }
    end
  end
end
